First, the last three test cases are submitted through theSecond, study the learning StringBuffer in the way of TDD, submit the unit test case and test passThird, using [WHITESTARUML] to model the code in the experiment two, the Hair class diagram (class diagram only two fewer classes)Iv. Unit test code and running success and code-on-Cloud codes linkTask: Develop a plural class Complex in TDD, which requires the following://define properties and gene
:
Proficiency in TDD
Application of TDD to the test of complex program
Submission Point RequirementsDevelop a plural class complex in TDD mode,Submit your Unit test case and test pass, to add the number watermark;Results:Code HostingSubmission Point FiveKnowledge Points:
Learn to use WHITESTARUML
Master Whitestaruml, interfaces, declaring variable parameters, and so on.
S
(Imagepart = = 0) string = Realpart + ""; if (Imagepart
Test code ComplexTest Class
import org.junit.*;import static org.junit.Assert.*;public class ComplexTest { Complex a = new Complex(0, 2); Complex b = new Complex(2, -1); @Test public void testAdd() { assertEquals("2.0+1.0i", a.ComplexAdd(b).toString()); System.out.println(a.ComplexAdd(b)); } @Test public void testSub() { assertEquals("-2.0+3.0i", a.ComplexSub(b).toString());
()); System.out.println(a.ComplexMulti(b)); } @Test public void testDiv() { assertEquals("-0.4117647058823529+0.35294117647058826i", a.ComplexDiv(b).toString()); System.out.println(a.ComplexDiv(b)); }}
Test results
(v) UML diagram drawing
Experimental content
Use WHITESTARUML to model the code in experiment two, send class diagram, plus number watermark.
Reference
through OOA, Ood, and OOP is abstraction.Ood Modeling uses the graphical Modeling language UML (Unified Modeling Language), UML is a generic modeling language, we experiment with Umbrello for modeling, and Windows recommends that you use STARUML.The result of a process abstraction is a function, and the result of the data abstraction is an abstract data Type,adt, which can be used as an ADT with inherited and polymorphic mechanisms. Data abstraction is the core and origin of OOP.
Requi
Link:Https://gitee.com/BESTI-IS-JAVA-2018/java-besti-is-djw20165328/tree/master/shiyan22-4Submit: Unit test code and run success and code on the cloud Codes link, to add the number watermarkReference http://www.cnblogs.com/rocedu/p/6736847.htmlTask: Developing a plural class complex in TDD, with the following requirements:Define properties and generate Getter,setterDouble Realpart;Double Imagepart;Defining constructorsPublic Complex ()Public Complex (double r,double I)Override Objectpublic bool
similar unit tests, but I didn't find it.
Workaround:
Download Mysql-connector-java-5.1.46.zip
Unpack the Tarball
File->projeat Structure
Click Dependencies, click on the top right +-JARs to find the location of the decompression package-> Mysql-connector-java-5.1.41-bin.jar
According to the resources on the blue ink cloud download WHITESTARUML, based on the use of
code in the MyDoc class to indicate the correct addition, submit the test code and run knot, plus the number watermarkFour, object-oriented programming-4Checkpoint RequirementsSubmit: Unit test code and run success and code on the cloud Codes link, to add the number watermarkReference http://www.cnblogs.com/rocedu/p/6736847.htmlTask: Developing a plural class complex in TDD, with the following requirements:Define properties and generate Getter,setterDouble Realpart;Double Imagepart;Defining con
)) {return false; } Complex complex= (Complex) obj; if (complex. Realpart!= ((Complex) obj). Realpart) {return false; } if (complex. Imagepart!= ((Complex) obj). Imagepart) {return false; } return true; The public String toString () {string string= ""; if (imagepart>0) string=realpart+ "+" +imagepart+ "I"; if (imagepart==0) string=realpart+ ""; if (imagepartTest results such as(v) using STARUML to model the code in the experimentUse the tool
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.